
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>填写验证码</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no" />
    <link rel="stylesheet" href="../resources/css/public/reset.css" />
    <link rel="stylesheet" href="../resources/css/person/head.css" />
    <link rel="stylesheet" href="../resources/css/person/mobile_keyboard.css" />
    <link rel="stylesheet" href="../resources/css/person/verify_code.css" />
</head>
<body>
<!--头部-->
<header class="bxg-header">
    <a class="bxg-head-icon bxg-back" href="javascript:history.go(-1);"></a>
    填写验证码
    <span class="bxg-head-icon bxg-list"></span>
    <div class="head-list-content">
        <ul>
            <li><a href="" title=""><i class="bxg-collection-icon news-icon"></i>消息<b>5</b></a></li>
            <li><a href="" title=""><i class="bxg-collection-icon index-icon"></i>首页</a></li>
        </ul>
    </div>
</header>
<!--内容-->
<div class="bxg-content">

    <div class="bxg-send">正在为您发送到<span id="mobile"></span>验证码</div>

    <div class="bxg-import pass-inp bxg-clear">
        <input readonly class="pass" type="password" maxlength="1" value="" disabled="disabled">
        <input readonly class="pass" type="password" maxlength="1" value="" disabled="disabled">
        <input readonly class="pass" type="password" maxlength="1" value="" disabled="disabled">
        <input readonly class="pass" type="password" maxlength="1" value="" disabled="disabled">
        <input readonly class="pass" type="password" maxlength="1" value="" disabled="disabled">

    </div>
    <div class="bxg-verification">
        <button class="code-dtime" disabled="true">0秒</button>
    </div>
</div>
<div class="bxg-keyboard"></div>
<script type="text/javascript" charset="UTF-8" src="../resources/js/common/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="../resources/js/person/public.js"></script>
<script type="text/javascript" src="../resources/js/common/commonutil.js"></script>
<script type="text/javascript" src="../resources/js/person/mobile_keyboard.js" ></script>
<script type="text/javascript">
    $(function(){
        //从url中获取需要重新修改的验证码
        var phone = getQueryString('phone');
        $('#mobile').text(phone.substring(0,3)+'****'+phone.substring(7));
        $(".bxg-list").click(function(){
            $(".head-list-content").toggle();
        });
        //倒计时
        function dtime(obj,time){
            if(time>0){
                time--;
                obj.attr('disabled',true);
                obj.text(time+'秒重新获取');
            }else{
                obj.attr('disabled',false);
                obj.text('重新获取验证码');
                return false;
            }
            setTimeout(function(){
                dtime(obj,time);
            },1000);
        }
        $(".bxg-verification .code-dtime").click(function(){
            var url = '/person/sendPhoneCode?type=register&phone='+phone;
            //60秒过后可以重新发送手机验证码
            $.getJSON(url,function (data) {
                if (data.success) {
                    dtime($(this),60);
                }else {
                    alert(data.message);
                }
            });

        });
//				$.ajax({
//					type:"get",
//					url:"",
//					success:function(){
//						$(".bxg-verification .code-dtime").text(60+'秒重新获取');
        dtime($(".bxg-verification .code-dtime"),60);


//					},
//					error:function(){
//
//					}
//				});


    });
</script>
</body>
</html>
